//
//  YFHomeBtn.m
//  QuanJieShopProject
//
//  Created by 杨帆 on 2018/3/28.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "YFHomeBtn.h"

@implementation YFHomeBtn

+ (YFHomeBtn *)buttonWithTitle:(NSString *)title imageName:(NSString *)imageName withSize:(CGSize)size {
    
    YFHomeBtn *btn = [[YFHomeBtn alloc] init];
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitleColor:YFColor_Text forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    btn.bounds = CGRectMake(0, 0, size.width, size.height);
    btn.titleLabel.font = [UIFont systemFontOfSize:12];
    
    [btn layoutButtonWithEdgeInsetsStyle:LLButtonStyleTextBottom imageTitleSpace:0];
    
    return btn;
}


// 150 130
//+ (YFHomeBtn *)buttonWithTitle:(NSString *)title imageName:(NSString *)imageName {
//
//    YFHomeBtn *btn = [[YFHomeBtn alloc] init];
//    [btn setTitle:title forState:UIControlStateNormal];
//    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
//    btn.bounds = CGRectMake(0, 0, 75, 75);
//    btn.titleLabel.font = [UIFont systemFontOfSize:12];
//
//
//
//#pragma TODO
//    CGFloat offset = 0.0f; // 这里先写死
//    btn.imageEdgeInsets = UIEdgeInsetsMake(10, 20, 30, 20);
//    btn.titleEdgeInsets = UIEdgeInsetsMake(0, -80, -35, 0);
//
//    //    CGFloat imageHeight = 35;
//    //    CGFloat imageWidth = 35;
//    //    CGFloat space = 20;
//    //    CGFloat titleHeight = 25;
//    //    CGFloat titleWidth = 75;
//    //    [button setImageEdgeInsets:UIEdgeInsetsMake(-(imageHeight*0.5 + space*0.5), titleWidth*0.5, imageHeight*0.5 + space*0.5, -titleWidth*0.5)];
//    //    [button setTitleEdgeInsets:UIEdgeInsetsMake(titleHeight*0.5 + space*0.5, -imageWidth*0.5, -(titleHeight*0.5 + space*0.5), imageWidth*0.5)];
//
//
//    //    UIEdgeInsetsMake(-button.titleLabel.intrinsicContentSize.height-offset/2, 0, 0, -button.titleLabel.intrinsicContentSize.width);
//    return btn;
//}

@end
